<template>
	<view>
		<fui-tabbar :tabBar="tabBar2" :selectedColor="selectedColor"  
		:hump="hump" :current="current" @click="tabbarSwitch">
		</fui-tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				hump:false,
				current: 0,
				selectedColor:"#000000",
				tabBar2: [{
						"pagePath": "index",
						"text": "组件",
						"iconPath": "https://fui-1255369109.cos.ap-nanjing.myqcloud.com/static%2Fcomponents%2FtabBar%2Findex.png",
						"selectedIconPath": "https://fui-1255369109.cos.ap-nanjing.myqcloud.com/static%2Fcomponents%2FtabBar%2Findex-active.png",
					},
					{
						"pagePath": "example",
						"text": "页面",
						"iconPath": "https://fui-1255369109.cos.ap-nanjing.myqcloud.com/static%2Fcomponents%2FtabBar%2Fvip.png?q-sign-algorithm=sha1&q-ak=AKIDapuR-LExeuvmdRNKChy0Kk7BGduyf_WQAQsJzjVlCMFk6s9fQZn5yLh1cP0YUYt2&q-sign-time=1657096420;1657100020&q-key-time=1657096420;1657100020&q-header-list=&q-url-param-list=&q-signature=39f20af1c0b54ecce823fef98820e15439f1f98e&x-cos-security-token=91uCiaCX81ZfbDaZfcx4dLB7ZYW3s6Oad292030ea5ba03b3b164c9e4bb9545487qeGddM_-xFpuF47qMqNua171_rD-627SiciTiuyXCGbH8vCeYKePVHvoCIBh7pJPOXC2QGJ8K6QC8mMOz8YTdnvUoOtaEHKLap2JIeWqslyIZMfbUYWzNORDcfkTH5Z4lDe805aHq52CbZlT4H3gIPtEJWZlsZZjXQGKSkQ4H0PgaIJKF4Ors4jDNUFMGOw",
						"selectedIconPath": "https://fui-1255369109.cos.ap-nanjing.myqcloud.com/static%2Fcomponents%2FtabBar%2Fvip-active.png",
						"isDot": true,
						"verify": true
					}
				],
			}
		},
		props:{
			currentindex:{
				type: Number,
				default: 0
			}
		},
		created() {
			let that = this
			if(this.currentindex){
				this.current = this.currentindex
			}else{
				this.current = that.$store.state.currentindex
			}
			console.log('切换页面',this.current)
		},
		methods: {
			tabbarSwitch(e) {
				let that = this
				//获取登录状态，此处默认未登录
				let isLogin=false
				console.log('切换页面',e.pagePath,e,e.index)
				that.$store.state.currentindex = e.index
				that.$forceUpdate()
				console.log('当前第几个',e.index)
				// if(e.index == 3){
				// 	that.$Router.push({name:e.pagePath})
				// }else{
				// }
				that.$Router.replaceAll({name:e.pagePath})
			},
		}
	}
</script>

<style>
	
</style>
